package cn.cimoc.service;

import cn.cimoc.model.dto.output.AddressDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author LGZ
 * @date 2022/7/16 14:55
 * <p>
 */
public interface AddressService {
    /**
     * 获取地址
     * @param uid /
     * @return data
     */
    List<AddressDTO> getAddress(long uid);

    /**
     * 设置默认地址
     * @param aid aid
     * @param uid uid
     */
    void setDefault(long aid, long uid);

    /**
     * 删除
     * @param aid aid
     */
    @Transactional(rollbackFor = Exception.class)
    void delete(long aid);

    /**
     * 添加收货地址
     * @param receiver /
     * @param provinceCode /
     * @param cityCode /
     * @param areaCode /
     * @param zip /
     * @param address /
     * @param phone /
     * @param tel /
     * @param tag /
     * @param username /
     * @param uid /
     */
    void add(String receiver,
             String provinceCode,
             String cityCode,
             String areaCode,
             String zip,
             String address,
             String phone,
             String tel,
             String tag,
             String username,
             long uid);
}
